#ifndef utilitypanel_h
#define utilitypanel_h

#include "juce_amalgamated.h"
#include "UtilityButton.h"
#include "SelectableUtilityButton.h"
#include "../MiscGraphics.h"

/*
 * Base class for utility panels, factoring out common code
 */
class UtilityPanel: public Component
{
private:
	String title;
	Font* textFont;

protected:


public:
	UtilityPanel(String title)
	{
		this->title = title;
		textFont = new Font(Font::getDefaultSansSerifFontName(), 18,  Font::plain);
	}

	~UtilityPanel() {
		delete textFont;
	}

	virtual void buttonClicked(int buttonID) = 0;
protected:
	void paint(Graphics& g)
	{
		Rectangle r(0, 0, getWidth(), getHeight());
		g.setColour(Colours::white);
		g.fillRoundedRectangle(r, 30);
		g.setColour(Colours::darkgrey);
		MiscGraphics::drawRoundedRect(g, r, 30, 1);

		g.setColour(Colours::black);
		g.setFont(Font(Font::getDefaultSansSerifFontName(), 24, Font::plain));
		g.drawFittedText(title, 0, 0, getWidth(), 60, Justification::centred, 1);

		paintPanel(g);
	}

	virtual void paintPanel(Graphics& g) = 0;
};

#endif
